<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('Orders/index')}">订单管理</a></li>
			<li><a href="{:url('Orders/addorders')}">创建订单</a></li>
		</ul>

        <div>
            <form class="well form-inline margin-top-20" action="{:url('Orders/index')}" method="get">
                <label>姓名:
                    <input type="text" class="form-control" name="customer_name" placeholder="请输入名称"
                           value="{:input('request.customer_name')}">
                    手机号: <input type="text" class="form-control" name="customer_phone" value="{:input('request.customer_phone/s','')}" placeholder="请输入手机号">
                </label>
                <input type="submit" class="btn btn-primary" value="搜索"/>
                <a class="btn btn-danger" href="{:url('Orders/index')}">清空</a>
            </form>
        </div>
       <form class="js-ajax-form" method="post">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>订单ID</th>
                    <th>客户名称</th>
                    <th>联系电话</th>
                    <th>墓位编号</th>
                    <th>具体位置</th>
                    <th>销售价格</th>
                    <th>选位时间</th>
                    <th>保留截止时间</th>
                    <th>导购员</th>
                    <th >操作</th>
                </tr>
            </thead>
            <tbody>
   
                <foreach name="results" item="vo">
                <tr>
                    <td>{$vo.order_sn}</td>
                    <td>
                    	{$vo['customer_name']}
                    </td>
                    <td>{$vo.customer_phone}</td>
                    <td>{$vo.tomb_num}</td>
                    <td>{$vo.tomb_address}</td>
                  	<td>{$vo.sell_price}</td>
                    <td><php>echo date('Y-m-d', $vo['sell_time'])</php></td>
                    <td><php>echo date('Y-m-d', $vo['end_time'])</php></td>
                    <td>{$vo.user_nickname}</td>
                    <td>
                        <if condition="$vo.cate_id eq 4">
                            <a href="{:url('Deposit/tomb_deposit',array('tomb_id'=>$vo['tomb_id']))}">寄存</a>
                        </if>
                        <if condition="$vo.col_status eq 1 || $vo.col_status eq 2 ">
                            <a href="{:url('Orders/sale',array('orders_ids'=>$vo['id'],'tomb_id'=>$vo['tomb_id']))}">认购</a>
                        </if>

                        <a href="{:url('Orders/cancel',array('id'=>$vo['id'],'tomb_num'=>$vo['tomb_num']))}" class="js-ajax-delete" data-msg="确定取消么？">取消</a>
                        <a href="{:url('Orders/visua',array('orders_id'=>$vo['id']))}">换位</a>
                    </td>
                </tr>
                </foreach>
            </tbody>
        </table>
        </form>
        <div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>
    <script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
    <script type="text/javascript">

		// 导出订单
		function ExportOrder(){
			var checkedLen = $("input.js-check:checked").length; 
			var order_id = checkedLen > 0 ? "'" : "";
			$("input.js-check:checked").each(function(index, element) {
                order_id += ($(this).val() + (index == (checkedLen - 1) ? "'" : "','"));
            });
			$(".hide").attr("href", "{:url('Orders/expOrder')}"+"&"+$(".form-search").serialize()+"&order_id=" + order_id);
			document.getElementById("exportOrder").click();
		}
	</script>
</body>
</html>